<html lang="en">
<head>
<meta name="viewport"
"content-"width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>promise对象的race方法</title>
</head>
<body>
</body>
<script>
B
//race(）将多个promsie对象实例包装成新的promise对象
//如果多个实例中状态都为fulfilled

let promise1 = new Promise((resoive,reject)=>(
setTimeout(()=>{
resolve(1000)
},1000)
})
let promise2 = new Promise((resolve,reject)=>(
setTimeout(()=>{
resolve('hello')
},1000)
})

let promise3 = new Promise((resolve,reject)=>{
setTimeout(()=>{
reject('promise3失败了'）
},1000)
})
let promise4 = Promise.race([promise1,promise2,promise3])
.then((res)=>{